//package com.wq.httpclientcore.factory;
//
//import com.wq.httpclientcore.config.HttpClientInvocationHandler;
//import com.wq.httpclientcore.common.ICommonClient;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//import org.springframework.web.client.RestTemplate;
//
//import java.lang.reflect.Proxy;
//
//@Component
//public class HttpClientFactory {
//
//    @Autowired
//    private RestTemplate restTemplate;
//
//    public <T> T createClient(Class<T> clazz) {
//        return (T) Proxy.newProxyInstance(
//                clazz.getClassLoader(),
//                new Class<?>[]{clazz},
//                new HttpClientInvocationHandler(restTemplate, clazz));
//    }
//
//}